package com.wzn.service;

import com.wzn.service.ConfigService;
import com.wzn.service.OrderService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.SQLException;

public final class SpringNamespaceWithAssignedDataSourceMain {


    public static void main(final String[] args) throws SQLException {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:applicationContextWithAssignedDataSource.xml");
        System.out.println("[Monitor] [INFO] applicationContext = "+applicationContext);

        OrderService service =  applicationContext.getBean(OrderService.class);
        //service.insert();
        //service.select();
        //service.delete();
        service.select();
    
        ConfigService configService =  applicationContext.getBean(ConfigService.class);
        //configService.select();
    }
}
